#ifndef PAGE1_VIDEO_H
#define PAGE1_VIDEO_H

#include "data_upup.h"

#include <QTimer>
#include <QDebug>
#include <QWidget>
#include <QPainter>
#include <QByteArray>
#include <opencv2/opencv.hpp>
#include <opencv4/opencv2/opencv.hpp>

namespace Ui {
class page1;
}

class page1 : public QWidget
{
    Q_OBJECT

public:
    explicit page1(QWidget *parent = nullptr);
    ~page1();

    Data_upup * data_upup;

    Ui::page1 * ui;

    cv::Mat read_now_frame();

signals:
    void pushbutton_page1_clicked();

    void pushbutton_page2_clicked();

    void pushbutton_page3_clicked();

    void pushbutton_page4_clicked();

    void reload_frame();
public slots:
    void on_pushButton_page1_clicked();

    void on_pushButton_page2_clicked();

    void on_pushButton_page3_clicked();

    void on_pushButton_page4_clicked();

    void on_pushButton_open_clicked();

    void show_video();

    void on_pushButton_deep_clicked();

    void on_pushButton_pingdong_clicked();

    void on_pushButton_zhuandong_clicked();

    void on_pushButton_arm_shen_clicked();

    void on_pushButton_arm_stop_clicked();

    void on_pushButton_arm_shou_clicked();

    void on_pushButton_hand_zhua_clicked();

    void on_pushButton_hand_stop_clicked();

    void on_pushButton_hand_zhang_clicked();

    void on_pushButton_light_open_clicked();

    void on_pushButton_light_close_clicked();

    void on_pushButton_camera_lock_clicked();

    void on_pushButton_camera_unlock_clicked();

    void on_pushButton_cmaera_return_clicked();

    void on_pushButton_camera_turn_clicked();

    void on_pushButton_pwm_clicked();

    void debug_print(QByteArray);

    void set_lineEdit_pingdong_x(double num);

    void set_lineEdit_pingdong_y(double num);

    void set_lineEdit_pingdong_z(double num);

    void set_lineEdit_zhuandong_roll(double num);

    void set_lineEdit_zhuandong_pitch(double num);

    void set_lineEdit_zhuandong_yaw(double num);

    void print_move_data();

private slots:
    void on_pushButton_shoubing_clicked();

private:
    cv::VideoCapture capture;
    QTimer * timer_for_video;
    cv::Mat frame;
    QTimer * timer_for_move;
};

#endif // PAGE1_VIDEO_H
